/*
 * Lab5B.cpp
 *
 *  Created on: Mar 3, 2013
 *  Author:     Anthony Varghese
 *  Description: Simple program showing how to use the vector class
 *
 */

#include <iostream>
#include <vector>

using namespace std;

int main(){
 	vector x; // compile error!

	vector<int> vi;

	vi[0] = 10; // run time error!

	vi.push_back( 3 );
	vi.push_back( 4 );
	vi.push_back( 5 );

	vi[0] = 10; // this is OK!

	cout << " The capacity of vi is " << vi.capacity() << " and\n";
	cout << "     its size is       " << vi.size() << endl;
	cout << " The elements of vi are: ";
	for (int i=0; i<vi.size(); i++)
		cout << vi[i] << " ";
	cout << endl;

	/*
	vi.pop_back();
	vi.pop_back();
	vi.pop_back();

	cout << " The capacity of vi is " << vi.capacity() << " and" << endl;
	cout << "     its size is       " << vi.size() << endl;
    */

	return 0;
}


